package main

import (
	"Demo03/part13_1/MyFuncGetIndex"
	"github.com/gin-gonic/gin"
	"net/http"
)

func main() {
	r := gin.Default()
	r.LoadHTMLGlob("part13_1/templates/**/*")

	r.StaticFS("/s", http.Dir("part13_1/static"))

	r.GET("/", MyFuncGetIndex.GetIndex)
	//form表单进行调用的地址
	r.GET("/BandingForm", MyFuncGetIndex.BandingForm)

	//访问地址栏进行拼接
	//http://localhost:8080/BandingUrl?username=%E4%B8%BD%E4%B8%BD&age=123123
	r.GET("/BandingUrl", MyFuncGetIndex.BandingUrl)

	//获取json绑定调用的首界面
	r.GET("/getjsonindex", MyFuncGetIndex.JsonIndex)

	//处理ajax请求
	r.POST("/postBanding", MyFuncGetIndex.AjaxJson)

	//绑定URI
	//http://localhost:8080/BandingUrI/张三/12

	r.GET("/BandingUrI/:uname/:age", MyFuncGetIndex.GetBindUri)

	r.Run()

}
